<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
  String _id=request.getParameter("_");
  request.setAttribute("now",new Date());
%>

<div class="row">
    <div class="col-lg-12">
        <div class="panel">
            <%--<div class="panel-heading">--%>
                <%--<h3 class="panel-title">任务发起登记表</h3>--%>
            <%--</div>--%>

            <form id="form_task_history" class="panel-body form-horizontal form-padding">

                <div class="form-group">
                    <label class="col-md-2 control-label">所属项目<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-10">
                        <input type="text" id="dictItemH" class="form-control" value="${task.dictItem.name}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        关联任务
                    </label>
                    <div class="col-md-10 input-group mar-btm">
                        <input type="text" id="relateTaskNamesH" class="form-control" disabled
                               value="<c:forEach var="item" items="${task.relateTasks}" varStatus="status">${item.name}<c:if test="${!status.last}">,</c:if></c:forEach>">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">任务名称<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-10">
                        <input type="text" id="nameH" class="form-control" disabled value="${task.name}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">详细要求<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-10">
                        <input type="hidden" id="detailH" class="form-control" value="${task.detail}">
                        <div id="detail-summernote">

                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        任务责任人
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-10">
                        <input type="text" id="leaderNamesH" class="form-control" disabled
                               value="<c:forEach var="item" items="${task.leaders}" varStatus="status">${item.name}<c:if test="${!status.last}">,</c:if></c:forEach>">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        任务组员
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-10">
                        <input type="text" id="memberNamesH" class="form-control" disabled
                               value="<c:forEach var="item" items="${task.members}" varStatus="status">${item.name}<c:if test="${!status.last}">,</c:if></c:forEach>">
                    </div>
                </div>

                <div class="form-group div-Hidden">
                    <label class="col-md-2 control-label">计划开始时间<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-10">
                        <div class="input-group date">
                            <input type="text" class="form-control" id="datPlanStartH" disabled
                                   value=<fmt:formatDate pattern="yyyy-MM-dd" value="${task.datPlanStart}" /> >
                            <span class="input-group-addon"><i class="ti-calendar"></i></span>
                        </div>
                    </div>
                </div>

                <div class="form-group div-Hidden">
                    <label class="col-md-2 control-label">计划完成时间<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-10">
                        <div class="input-group date">
                            <input type="text" class="form-control" id="datPlanEndH" disabled
                                   value=<fmt:formatDate pattern="yyyy-MM-dd" value="${task.datPlanEnd}" /> >
                            <span class="input-group-addon"><i class="ti-calendar"></i></span>
                        </div>
                    </div>
                </div>

                <div class="form-group div-Hidden">
                    <label class="col-md-2 control-label">预警时间<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-10">
                        <div class="input-group date">
                            <input type="text" class="form-control" id="datWarningH" disabled
                                   value=<fmt:formatDate pattern="yyyy-MM-dd" value="${task.datWarning}" /> >
                            <span class="input-group-addon"><i class="ti-calendar"></i></span>
                        </div>
                    </div>
                </div>


                <div class="form-group">
                    <label class="col-md-2 control-label">优先程度<i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-10">
                        <input type="text" id="priorityH" class="form-control" disabled value="${priority}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">相关附件<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input name="uploadify" id="filename" style="display: none"  placeholder="" type="file" >
                        <input name="fileId" id="fileId" style="display: none" value="${fileId}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">提交人</label>
                    <div class="col-md-2">
                        <p class="form-control-static">${task.creater.name}</p>
                    </div>
                    <label class="col-md-2 control-label">提交日期</label>
                    <div class="col-md-2">
                        <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd" value="${task.dateApply}" /></p>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>

<script>

    // 附件显示
    readLoad({
        objId:"filename",
        entityName:"fileIds",
        sourceId:"fileId"
    });

    // 加载完成后执行
    $(function(){
        //赋值
        var sHtml = $("#detail").val();
        if(sHtml.length>0){
            $('#form_task_history #detail-summernote').summernote("code",sHtml);
            $('#form_task_history .note-editable').attr('contenteditable', false);
            $('#form_task_history .note-control-selection').remove();
        }
    })

</script>
